execute as @e[type=minecraft:item,nbt={Item:{id:"minecraft:flint",Count:1b}}] at @s if block ~ ~ ~ #minecraft:beds at @s if entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:charcoal",Count:1b}}] run function sire:craft/gunpowder